package io.admin.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import io.admin.modules.item.dao.TokenDao;
import io.admin.modules.item.dto.TokenDTO;
import io.common.entity.TokenEntity;
import io.admin.modules.item.service.TokenService;
import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 用户Token
 *
 * @author BS #
 * @since 1.0.0 2024-04-19
 */
@Service
public class TokenServiceImpl extends CrudServiceImpl<TokenDao, TokenEntity, TokenDTO> implements TokenService {

    @Override
    public QueryWrapper<TokenEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<TokenEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


}